using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Centalstock : IAccessible<T_Centalstock, Centalstock>, ILogicEntity<T_Centalstock, Centalstock>
    {
        public int GoodsID { get; set; }

        public int ActualStock { get; set; }

        public int FrozenStock { get; set; }

        public int WarningValue { get; set; }

        protected override void Covariant(T_Centalstock model)
        {
            if (model != null)
            {
                    this.GoodsID = model.GoodsID;
                    this.ActualStock = model.ActualStock;
                    this.FrozenStock = model.FrozenStock;
                    this.WarningValue = model.WarningValue;
            }
}
        protected override T_Centalstock Inverter(Centalstock model)
        {
            if (model != null)
            {
                return new T_Centalstock()
                {
                    GoodsID = model.GoodsID,
                    ActualStock = model.ActualStock,
                    FrozenStock = model.FrozenStock,
                    WarningValue = model.WarningValue,
                };
            }
            return null;
        }
        public Centalstock Set(T_Centalstock dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
